import { Input, Select } from "@arco-design/web-vue";
import type { ComponentType, ModuleConfig } from "@/views/table/types";
interface Row {
  state: { [k in string]: any };
  key: string;
  props: { [k in string]: any };
  placeholder: string;
  emit: (k: string, payload?: any) => void;
  width?: string;
}
// const test = reactive({});
export const componentMap: {
  [k in ComponentType]: (row: Row) => JSX.Element;
} = {
  select: (row: Row) => (
    <Select
      v-model={row.state[row.key]}
      class="mr-2"
      style={{ width: row.width || "14rem" }}
      placeholder={row.placeholder}
      {...row.props}
    />
  ),
  input: (row: Row) => (
    <Input
      v-model={row.state[row.key]}
      class="mr-2"
      style={{ width: row.width || "14rem" }}
      placeholder={row.placeholder}
      {...row.props}
    />
  ),
};
